﻿using MediatR;
using StoreIGet.Applications.Command;
using StoreIModels;
using StoreRepositorys.Interface;

namespace StoreIGet.Applications.CommandHandler
{
    /// <summary>
    /// 分类相册反填
    /// </summary>
    public class SystematicBackCommandler : IRequestHandler<SystematicBackCommand, SystematicModel>
    {
        public readonly ISystematicRepository _systematicRepository;
        public SystematicBackCommandler(ISystematicRepository systematicRepository)
        {
            _systematicRepository = systematicRepository;
        }

        public async Task<SystematicModel> Handle(SystematicBackCommand request, CancellationToken cancellationToken)
        {
            //throw new NotImplementedException();
            return await _systematicRepository.GetModelasync(request.SystematicId);
        }
    }
}
